-module(bnode_data).
-export([
	node_data/1,
	group_list/0,
	group_sort_list/1,
	group_data/1
]).

%% 节点id => {处理模块，参数}
node_data(101) -> {bnode_action, [{ai, calc, [bigger, 1,2]}]};
node_data(102) -> {bnode_selector, []};
node_data(103) -> {bnode_successer, []};
node_data(104) -> {bnode_inverter, []};
node_data(105) -> {bnode_sequences, []};
node_data(106) -> {bnode_repeater, []};
node_data(107) -> {bnode_action, [{ai, calc, [smaller, 1,2]}]};
node_data(201) -> {bnode_selector, []};
node_data(202) -> {bnode_successer, []};
node_data(203) -> {bnode_inverter, []};
node_data(204) -> {bnode_sequences, []};
node_data(205) -> {bnode_repeater, []};
node_data(206) -> {bnode_action, [{ai, calc, [bigger, 1,2]}]};
node_data(207) -> {bnode_action, [{ai, calc, [smaller, 1,2]}]};
node_data(_Info)-> undefined.

%% 节点分组
group_list()->[1, 2, 3].

%% 每组节点有哪些树结构
group_sort_list(3) ->   [1, 2, 3];
group_sort_list(2) ->   [1, 2];
group_sort_list(1) ->   [1, 2];
group_sort_list(_)->[].

%% 每个树结构对应的[{父节点, 孩子节点列表}]
group_data({1, 1}) -> [{0,[105]}];
group_data({1, 2}) -> [{105,[107,101]}];
group_data({2, 1}) -> [{0,[102]}];
group_data({2, 2}) -> [{102,[107,101]}];
group_data({3, 1}) -> [{0,[201]}];
group_data({3, 2}) -> [{201,[206,204,207]}];
group_data({3, 3}) -> [{204,[207,206]}];
group_data(_Info)-> undefined.